package com.tingyuge.base.design.chain;

/**
 * @Created by xiaodao
 */
public class Client {
    public static void main(String[] args) {

        LeaderHandlerChain directorChain = new DirectorChain("张三");
        LeaderHandlerChain manger = new ManageChain("李四");
        LeaderHandlerChain generalManage = new GeneralManageChain("王五");
        LeaderHandlerChain auto = new NoSupportLeaveChain("机器");

        //组织链式关系

        directorChain.setNextLeader(manger);
        manger.setNextLeader(generalManage);
        generalManage.setNextLeader(auto);

        LeaveRequest emt = new LeaveRequest("小刀","想请假回去学习",21);

        directorChain.handlerRequest(emt);

    }
}
